<script setup>
	import { computed } from 'vue'
	const customStickyProps = defineProps({
		backgroundColor: {
			type: String,
			default: '#fff',
		},
		offsetTop: {
			type: [String, Number],
			default: 0,
		},
	})
	const stickStyle = computed(() => {
		return {
			background: customStickyProps.backgroundColor,
			paddingTop: customStickyProps.offsetTop,
		}
	})
	console.log("customStickyProps.offsetTop",customStickyProps.offsetTop)
</script>
<template>
	<view class="custom-sticky" :style="stickStyle">
		<slot></slot>
	</view>
</template>

<style lang="scss" scoped>
	.custom-sticky {
		position: sticky;
		z-index: 100;
		top: 0rpx;
	}
</style>
